<?php /* Smarty version 2.6.18, created on 2010-03-16 11:18:00
         compiled from orgInventory.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'cycle', 'orgInventory.tpl', 94, false),array('modifier', 'number_format', 'orgInventory.tpl', 108, false),)), $this); ?>
<div id="blanket" style="display:none;"></div>
<div id="daa" style="background-color:#fff;width:800px;z-index: 1002;display:none;position: absolute;"></div>
<div id="download" style="position:absolute;background-color:#fff;width:400px;z-index: 1002;display:none;"></div>

<script>	
	var dd = new ekimo_drag_region("content","daa");
</script>

<div id="main_content">
    	<h1>Inventory</h1>
        
			<div class="blue">
        	    <form action="" id="filterForm" >
        	        <table>
        	            <tr>
        	                <td><label for="filter">Tanks:</label></td>
        	                <td><select name="user[tank]" onchange="doajaxAction('/account/orgInventory/reload/1',1,'result',document.getElementById('filterForm'))">
            	                <option value="">All Tanks</option>
        	                    <?php $_from = $this->_tpl_vars['orgTanks']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['tank']):
?>
        	                        <option value="<?php echo $this->_tpl_vars['tank']['tank_id']; ?>
"><?php echo $this->_tpl_vars['tank']['name']; ?>
</option>
        	                    <?php endforeach; endif; unset($_from); ?>
        	                </select></td>
        	            </tr>
        	            <tr>
        	                <td><label for="filter">MOID:</label></td>
        	                <td><select name="user[moid]" onchange="doajaxAction('/account/orgInventory/reload/1',1,'result',document.getElementById('filterForm'))">
        	                    <option value="">All Species</option>
        	                    <?php $_from = $this->_tpl_vars['moids']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['moid']):
?>
        	                        <option value="<?php echo $this->_tpl_vars['moid']['moid']; ?>
"><?php echo $this->_tpl_vars['moid']['moid']; ?>
</option>
        	                    <?php endforeach; endif; unset($_from); ?>
        	                </select></td>
        	            </tr>
        	            <tr>
        	                <td><label for="filter">Group:</label></td>
        	                <td><select name="user[organismGroup]" onchange="doajaxAction('/account/orgInventory/reload/1',1,'result',document.getElementById('filterForm'))">
        	                    <option value="">Any Group</option>
        	                    <?php $_from = $this->_tpl_vars['organismGroups']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['group']):
?>
        	                        <option value="<?php echo $this->_tpl_vars['group']['organism_group_id']; ?>
"><?php echo $this->_tpl_vars['group']['organism_group']; ?>
</option>
        	                    <?php endforeach; endif; unset($_from); ?>
        	                </select></td>
        	            </tr>
        	            <tr>
    						<td><label for="filter">Name Filter:</label></td>
    						<td>
    							<select name="user[alpha]" onchange="doajaxAction('/account/orgInventory/reload/1',1,'result',document.getElementById('filterForm'))" >
    								<option value="">No Filter</option>
    								<option value="#" selected>#</option>
    								<option value="a">A</option><option value="b">B</option><option value="c">C</option><option value="d">D</option><option value="e">E</option><option value="f">F</option><option value="g">G</option><option value="h">H</option><option value="i">I</option><option value="j">J</option><option value="k">K</option><option value="l">L</option><option value="m">M</option><option value="n">N</option><option value="o">O</option><option value="p">P</option><option value="q">Q</option><option value="r">R</option><option value="s">S</option><option value="t">T</option><option value="u">U</option><option value="v">V</option><option value="w">W</option><option value="x">X</option><option value="y">Y</option><option value="z">Z</option>
    							</select>				
    						</td>
    					</tr>
        	            <tr>
                            <td>
                                Other Filter:</td>
                            <td><select name="user[otherFilter]" onchange="doajaxAction('/account/orgInventory/reload/1',1,'result',document.getElementById('filterForm'))">
                                <option value="">None</option>
                                <option value="1">Below Reorder Level</option>
                                <!-- <option value="2">No Stock Only</option> -->
                                <option value="3">Has DAA Profile</option>
                            </select></td>
                        </tr>
                        <tr>
        	                <td><label for="filter">Search Name:</label></td>
        	                <td style="white-space:nowrap;">
					<input name="user[searchName]" type="text" onchange="doajaxAction('/account/orgInventory/reload/1',1,'result',document.getElementById('filterForm'))"/>
					&nbsp;&nbsp;&nbsp;
					<input type="button" value="Save to Excel" onclick="saveToExcel();">
				</td>
        	            </tr>
        	        </table>
        	    </form>
        	</div>
       
            <div id="result">
				<div>
					<table border="0" width="100%">
					<tr><td colspan="12"><hr></td></tr>
					<tr>
						<td>Tank</td>
						<td align="center">Image</td>
						<td>MOID</td>
						<td>Group</td>
						<td>Common Name</td>
						<td>Size</td>
						<td align="right">On-Hand</td>
						<td align="right">On-Shipment</td>
						<td align="right">Stock Amt</td>
						<td>MAC Certified</td>
						<td align="right" style="padding-left: 5pt, padding-right: 5pt">&nbsp;&nbsp;DAA&nbsp;&nbsp;</td>
						<td align="right">Last DAA</td>
					</tr>
					<tr><td colspan="12"><hr></td></tr>
					<?php $_from = $this->_tpl_vars['orgInventory']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['inventory']):
?>
					<tr class="<?php echo smarty_function_cycle(array('values' => 'blue,notify'), $this);?>
">
						<!--<?php if ($this->_tpl_vars['inventory']['has_daa'] == '1'): ?>
							<td align="center" style="padding-left: 5pt, padding-right: 5pt">&nbsp;&nbsp;DAA History&nbsp;&nbsp;</td>
						<?php endif; ?>-->
						<td><?php echo $this->_tpl_vars['inventory']['tank_name']; ?>
</td>
						<td width="10%" align="center">   
							<img  onclick="PopEx(this, null, null, null, 300, 50, 'PopBoxImageLarge');" pbCaption="<i><?php echo $this->_tpl_vars['inventory']['scientific_name']; ?>
</i>, <?php echo $this->_tpl_vars['inventory']['common_name']; ?>
" id="trade<?php echo $this->_tpl_vars['key']; ?>
" width="98" src="/app/default/www/images/thumbs/<?php echo $this->_tpl_vars['inventory']['image']; ?>
.jpg" pbsrc="/app/default/www/images/thumbs/<?php echo $this->_tpl_vars['inventory']['image']; ?>
.jpg" class="PopBoxImageSmall" title="Click to magnify/shrink">
						</td>
						<td><?php echo $this->_tpl_vars['inventory']['moid']; ?>
</td>
						<td><?php echo $this->_tpl_vars['inventory']['organism_group']; ?>
</td>
						<td><?php echo $this->_tpl_vars['inventory']['common_name']; ?>
</td>
						<td><?php echo $this->_tpl_vars['inventory']['size']; ?>
</td>
						<td align="right"><?php echo $this->_tpl_vars['inventory']['total_qty_on_hand']; ?>
</td>
						<td align="right"><?php echo $this->_tpl_vars['inventory']['total_qty_on_shipment']; ?>
</td>
						<td align="right"><?php echo $this->_tpl_vars['inventory']['currency_mark']; ?>
&nbsp;<?php echo ((is_array($_tmp=$this->_tpl_vars['inventory']['total_stock_amount'])) ? $this->_run_mod_handler('number_format', true, $_tmp, "2%d") : number_format($_tmp, "2%d")); ?>
</td>
						<td><?php echo $this->_tpl_vars['inventory']['mac_certified']; ?>
</td>
						<td align="right"><?php echo $this->_tpl_vars['inventory']['quantity_daa']; ?>
&nbsp;&nbsp;</td>
						<td align="right">
							<a href="javascript:void(0);" onclick="showDAA('<?php echo $this->_tpl_vars['inventory']['inventory_id']; ?>
','<?php echo $this->_tpl_vars['inventory']['tank_name']; ?>
','<?php echo $this->_tpl_vars['inventory']['moid']; ?>
');"><?php echo $this->_tpl_vars['inventory']['date_mortality']; ?>
</a>
						</td>
					</tr>
					<?php endforeach; endif; unset($_from); ?>
					</table>
				</div>
            </div><!-- results -->
            
</div>
<script language="javascript">
<?php echo '
	function showDAA(inventoryId,tankName,moid){
		doajaxAction("/account/getInventoryDAA/inventoryId/"+inventoryId+"/tankName/"+tankName+"/moid/"+moid,0,\'daa\');
		popup("daa");
	}

	function saveToExcel(){
		doajaxAction("/account/saveOrgInventory",0,\'download\');
		popup("download");
	}
'; ?>

</script>